package com.xm.biz.impl;

import com.xm.biz.SearchHistoryBiz;
import com.xm.dao.SearchHistoryDao;
import com.xm.dao.impl.SearchHistoryDaoImpl;
import com.xm.po.SearchHistory;

import java.util.List;

/**
 * @author xie'lin'feng
 * @date 2020-08-15-9:16
 * @description 搜索历史业务逻辑层
 */
public class SearchHistoryBizImpl implements SearchHistoryBiz {
    //初始数据层
    SearchHistoryDao historyDao = new SearchHistoryDaoImpl();
    @Override
    public boolean add(SearchHistory searchHistory) {
        return historyDao.add(searchHistory);
    }

    @Override
    public boolean update(SearchHistory searchHistory) {
        return historyDao.update(searchHistory);
    }

    @Override
    public List<SearchHistory> getSearchHistoryTop5(Integer userId) {
        return historyDao.getSearchHistoryTop5(userId);
    }

    @Override
    public SearchHistory getSearchHistoryByUid(Integer userId, String key) {
        return historyDao.getSearchHistoryByUid(userId,key);
    }
}
